Total Complexity | 2 |
Total Lines | 14 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import {MigrationInterface, QueryRunner} from "typeorm"; |
||
2 | |||
3 | export class EventBillable1605556978071 implements MigrationInterface { |
||
4 | name = 'EventBillable1605556978071' |
||
5 | |||
6 | public async up(queryRunner: QueryRunner): Promise<void> { |
||
7 | await queryRunner.query(`ALTER TABLE "event" ADD "billable" boolean NOT NULL DEFAULT true`); |
||
8 | await queryRunner.query(`COMMENT ON COLUMN "project"."dayDuration" IS 'Stored in minutes'`); |
||
9 | await queryRunner.query(`ALTER TABLE "project" ALTER COLUMN "dayDuration" SET DEFAULT 420`); |
||
10 | } |
||
11 | |||
12 | public async down(queryRunner: QueryRunner): Promise<void> { |
||
13 | await queryRunner.query(`ALTER TABLE "project" ALTER COLUMN "dayDuration" SET DEFAULT 7`); |
||
14 | await queryRunner.query(`COMMENT ON COLUMN "project"."dayDuration" IS ''`); |
||
15 | await queryRunner.query(`ALTER TABLE "event" DROP COLUMN "billable"`); |
||
16 | } |
||
19 |